%%%% Identification
\ProvidesPackage{maxima}

%%%% Package loading
\RequirePackage{listings}

%%%% Main code

\lstdefinelanguage{maxima}
{morekeywords=
    {(, ), \%i, \%o, !!, !, \#, \%\%, \%, \%, \%e, \%edispflag, \%j,
    \%k, \%pi, \%rnum_list, \%th, '', ', *, +, -, ., /, :, ::, ::=,
    :=, <, =, >, ?round, ?truncate, ^, absboxchar, acos, acosh, acot,
    acoth, acsc, acsch, activate, activecontexts, addcol, additive,
    addrow, adjoint, airy, alarmclock, algebraic, algepsilon,
    algexact, algsys, alias, aliases, all_dotsimp_denoms, allbut,
    alloc, allroots, allsym, alphabetic, antid, antidiff,
    antisymmetric, append, appendfile, apply, apply1, apply2,
    apply_nouns, applyb1, apropos, args, array, arrayapply, arrayinfo,
    arraymake, arrays, asec, asech, asin, asinh, askexp, askinteger,
    asksign, assume, assume_pos, assume_pos_pred, assumescalar, asymp,
    asympa, at, atan, atan2, atanh, atom, atrig1, atvalue,
    augcoefmatrix, backsubst, backtrace, backup, bashindices, batch,
    batchkill, batchload, batcon, batcount, berlefact, bern, bernpoly,
    bessel, beta, bezout, bffac, bfloat, bfloatp, bfpsi, bftorat,
    bftrunc, bfzeta, bgzeta, bhzeta, bindtest, binomial, block,
    bothcases, bothcoef, box, boxchar, break, breakup, bug, burn,
    bzeta, cabs, canform, canten, carg, cartan, catch, cauchysum,
    cbfac, cf, cfdisrep, cfexpand, cflength, cgamma, cgamma2,
    change_filedefaults, changevar, charpoly, check_overlaps, chr1,
    chr2, christof, closefile, closeps, coeff,
    coefmatrix, col, collapse, columnvector, combine, commutative,
    comp2pui, compfile, compgrind, compile, compile_file,
    compile_lisp_file, concat, conjugate, cons, constant, constantp,
    cont2part, content, context, contexts, continue, contract,
    contract, copylist, copymatrix, cos, cosh, cot, coth, counter,
    covdiff, create_list, csc, csch, current_let_rule_package,
    cursordisp, curvature, dblint, ddt, deactivate, debug, debugmode,
    debugprintmode, declare, declare_translated, declare_weight,
    default_let_rule_package, defcon, define, define_variable, defint,
    defmatch, defrule, deftaylor, delete, delfile, delta, demo,
    demoivre, denom, dependencies, depends, derivabbrev, derivdegree,
    derivlist, derivsubst, describe, desolve, determinant, detout,
    diagmatrix, diagmetric, diff, dim, dimension, direc, direct,
    diskfree, disolate, disp, dispcon, dispflag, dispform, dispfun,
    display, display2d, display_format_internal, disprule, dispterms,
    distrib, divide, divsum, do, doallmxops, domain, domxexpt,
    domxmxops, domxnctimes, dontfactor, doscmxops, doscmxplus,
    dot0nscsimp, dot0simp, dot1simp, dotassoc, dotconstrules,
    dotdistrib, dotexptsimp, dotident, dotscrules, dotsimp, dpart,
    dscalar, dskall, dummy, echelon, eigenvalues, eigenvectors,
    einstein, ele2comp, ele2polynome, ele2pui, elem, eliminate, else,
    ematrix, endcons, entermatrix, entier, equal, erf, erfflag,
    errcatch, errexp, errintsce, error, error_size, error_syms,
    errorfun, errormsg, euler, ev, eval, evenp, evflag, evfun,
    example, exp, expand, expandwrt, expandwrt_denom,
    expandwrt_factored, explose, expon, exponentialize, expop,
    express, expt, exptdispflag, exptisolate, exptsubst,
    extract_linear_equations, ezgcd, facexpand, factcomb, factlim,
    factor, factorflag, factorial, factorout, factorsum, facts, false,
    fassave, fast_central_elements, fast_linsolve, fasttimes, feature,
    featurep, features, fft, fib, fibtophi, file_search,
    file_string_print, file_type, filedefaults, filename,
    filename_merge, filenum, fillarray, first, fix, float, float2bf,
    floatdefunk, floatnump, flush, flushd, flushnd, for, forget,
    fortindent, fortmx, fortran, fortspaces, fpprec, fpprintprec,
    freeof, fullmap, fullmapl, fullratsimp, fullratsubst, funcsolve,
    functions, fundef, funmake, gamma, gammalim, gauss, gcd, gcfactor,
    gendiff, genfact, genindex, genmatrix, gensumnum, get, getchar,
    gfactor, gfactorsum, globalsolve, go, gradef, gradefs,
    gramschmidt, grind, grobner_basis, hach, halfangles, hipow,
    horner, ibase, ic1, ident, ieqn, ieqnprint, if, ift, ilt,
    imagpart, in, in_netmath, inchar, indices, inf, infeval, infinity,
    infix, inflag, infolists, innerproduct, inpart, inrt, integerp,
    integrate, integration_constant_counter, interpolate, intfaclim,
    intopois, intosum, intpolabs, intpolerror, intpolrel, intsce,
    invert, is, isolate, isolate_wrt_times, isqrt, jacobi, kdelta,
    keepfloat, kill, killcontext, kostka, labels, laplace,
    lassociative, last, lasttime, lc, lcm, ldefint, ldisp, ldisplay,
    length, let, let_rule_packages, letrat, letrules, letsimp,
    lgtreillis, lhospitallim, lhs, limit, linear, linechar, linedisp,
    linel, linenum, linsolve, linsolve_params, linsolvewarn,
    lispdebugmode, list_nc_monomials, listarith, listarray,
    listconstvars, listdummyvars, listofvars, listp, lmxchar, load,
    loadfile, loadprint, local, log, logabs, logarc, logconcoeffp,
    logcontract, logexpand, lognegint, lognumer, logsimp, lopow,
    lorentz, lpart, lratsubst, lriccicom, ltreillis, m1pbranch,
    macroexpansion, mainvar, make_array, makebox, makefact, makegamma,
    makelist, map, mapatom, maperror, maplist, matchdeclare, matchfix,
    matrix, matrix_element_add, matrix_element_mult,
    matrix_element_transpose, matrixmap, matrixp, mattrace, max,
    maxapplydepth, maxapplyheight, maxnegex, maxposex, maxprime,
    maxtayorder, member, metric, min, minf, minfactorial, minor, mod,
    mode_check_errorp, mode_check_warnp, mode_checkp, mode_declare,
    mode_identity, modulus, mon2schur, mono, monomial_dimensions,
    motion, multi_elem, multi_orbit, multi_pui, multinomial,
    multiplicative, multiplicities, multsym, multthru, myoptions,
    nc_degree, ncexpt, ncharpoly, negdistrib, negsumdispflag,
    new-disrep, newcontext, newdet, newfac, newton, niceindices,
    niceindicespref, noeval, nolabels, nonscalar, nonscalarp,
    nostring, noun, noundisp, nounify, nouns, nroots, nterms, ntermsg,
    ntermsrci, nthroot, num, numberp, numer, numerval, numfactor,
    nusum, nzeta, obase, oddp, ode, ode2, omega, openplot_curves,
    opproperties, opsubst, optimize, optimprefix, optionset, orbit,
    ordergreat, ordergreatp, orderless, orderlessp, outative, outchar,
    outofpois, packagefile, pade, parsewindow, part, part2cont,
    partfrac, partition, partpol, partswitch, pcoeff, permanent,
    permut, pfeformat, pickapart, piece, playback, plog, plot2d,
    plot2d, plot2d_ps, plot3d, plot3d, plot_options, poisdiff,
    poisexpt, poisint, poislim, poismap, poisplus, poissimp, poisson,
    poissubst, poistimes, poistrim, polarform, polartorect,
    polynome2ele, posfun, potential, powerdisp, powers, powerseries,
    pred, prederror, prime, primep, print, printpois, printprops,
    prodhack, prodrac, product, programmode, prompt, properties,
    props, propvars, pscom, psdraw_curve, psexpand, psi, pui,
    pui2comp, pui2ele, pui2polynome, pui_direct, puireduc, put, qput,
    quit, qunit, quotient, radcan, radexpand,
    radprodexpand, radsubstflag, raiseriemann, random, rank,
    rassociative, rat, ratalgdenom, ratcoef, ratdenom, ratdenomdivide,
    ratdiff, ratdisrep, rateinstein, ratepsilon, ratexpand, ratfac,
    ratmx, ratnumer, ratnump, ratp, ratprint, ratrieman, ratriemann,
    ratsimp, ratsimpexpons, ratsubst, ratvars, ratweight, ratweights,
    ratweyl, ratwtlvl, read, readonly, realonly, realpart, realroots,
    rearray, rectform, recttopolar, refcheck, rem, remainder,
    remarray, rembox, remcon, remfunction, remlet, remove, remrule,
    remtrace, remvalue, rename, reset, residue, resolvante,
    resolvante_alternee1, resolvante_bipartite, resolvante_diedrale,
    resolvante_klein, resolvante_klein3, resolvante_produit_sym,
    resolvante_unitaire, resolvante_vierer, rest, restore, resultant,
    return, reveal, reverse, revert, rhs, riccicom, riemann,
    rinvariant, risch, rmxchar, rncombine, romberg, rombergabs,
    rombergit, rombergmin, rombergtol, room, rootsconmode,
    rootscontract, rootsepsilon, row, save, savedef, savefactors,
    scalarmatrixp, scalarp, scalefactors, scanmap, schur2comp,
    sconcat, scsimp, scurvature, sec, sech, set_plot_option,
    set_up_dot_simplifications, setcheck, setcheckbreak, setelmx,
    setup, setup_autoload, setval, show, showratvars, showtime, sign,
    signum, similaritytransform, simp, simpsum, sin, sinh, solve,
    solve_inconsistent_error, solvedecomposes, solveexplicit,
    solvefactors, solvenullwarn, solveradcan, solvetrigwarn, somrac,
    sort, sparse, splice, sprint, sqfr, sqrt, sqrtdispflag, srrat,
    sstatus, stardisp, status, step, string, stringout, sublis,
    sublis_apply_lambda, sublist, submatrix, subst, substinpart,
    substpart, subvarp, sum, sumcontract, sumexpand, sumhack,
    sumsplitfact, supcontext, symbolp, symmetric, system, tan, tanh,
    taylor, taylor_logexpand, taylor_order_coefficients,
    taylor_simplifier, taylor_truncate_polynomials, taylordepth,
    taylorinfo, taylorp, taytorat, tcl_output, tcontract, tellrat,
    tellsimp, tellsimpafter, tex, then, throw, thru, time, timer,
    timer_devalue, timer_info, tldefint, tlimit, tlimswitch, to_lisp,
    tobreak, todd_coxeter, toplevel, totaldisrep, totient, tpartpol,
    tr_array_as_ref, tr_bound_function_applyp, tr_file_tty_messagesp,
    tr_float_can_branch_complex, tr_function_call_default,
    tr_gen_tags, tr_numer, tr_optimize_max_loop,
    tr_output_file_default, tr_predicate_brain_damage, tr_semicompile,
    tr_state_vars, tr_true_name_of_file_being_translated, tr_version,
    tr_warn_bad_function_calls, tr_warn_fexpr, tr_warn_meval,
    tr_warn_mode, tr_warn_undeclared, tr_warn_undefined_variable,
    tr_warnings_get, trace, trace_options,
    transcompile, transform, translate, translate_file, transpose,
    transrun, treillis, treinat, triangularize, trigexpand,
    trigexpandplus, trigexpandtimes, triginverses, trigrat,
    trigreduce, trigsign, trigsimp, true, trunc, tsetup, ttransform,
    ttyoff, undeclaredwarn, undiff,
    uniteigenvectors, unitvector, unknown, unless, unorder, unsum,
    untellrat, untrace, use_fast_arrays, values, vect_cross,
    vectorpotential, vectorsimp, verb, verbify, verbose, weyl, while,
    with_stdout, writefile, xthru, zerobern, zeroequiv,
    zeromatrix, zeta\%pi, zeta, zrpoly, zsolve, zunderflow},
sensitive=false,
morecomment=[s]{/*}{*/},
morestring=[b]"}[keywords,comments,strings]
